<?php

class Form_Ask extends Form_Custom_General {

    public function init() {


        $name = $this->createElement('text', 'name')
                #->setRequired(TRUE)
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span8", "placeholder" => "Name"));
        $this->addElement($name);


        $phone = $this->createElement('text', 'phone')
                #->setRequired(TRUE)
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Phone should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span8", "placeholder" => "Phone"));
        $this->addElement($phone);


        $email = $this->createElement('text', 'email')
                #->setRequired(TRUE)
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Email address should not be blank.')))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span8", "placeholder" => "Email"));
        $email->getValidator('emailAddress')->setMessage("Email address is not valid.", Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($email);

        $question = $this->createElement('textarea', 'question')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Question should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array('class' => 'span8', "rows" => "8"));
        $this->addElement($question);
    }

}